package controller;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import pojo.Member;
import service.MyService;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * Created by wyj on 2019/3/4.
 */
@Controller
public class MyController {//哈哈哈
    @Resource
    private Member member;
    @Resource(name = "myservice")
    private MyService myService;

    @RequestMapping("/hello")
    public ModelAndView finduser() throws IOException {
        System.out.println("21234");
        ModelAndView mv=new ModelAndView("one");
        System.out.println("helloSSM");
        List<Member> members = myService.findall();
        mv.addObject("members",members);
        return  mv;
    }


}
